<?$this->load->view('admin/header');?>
<!-- Content Area -->
<div id="middlepart">
    <!-- Left column -->
    <div id="leftcolumn">
        <h1>Visitor Statistics</h1>

        <?$this->load->view('admin/visitor_options');?>

        <?$this->load->view('admin/system_messages');?>

        <!-- Tables 1 -->
        <table border="0" cellspacing="0" cellpadding="0" width="100%">
            <thead>
                <tr>
                    <th>Count</th>
                    <th>Referer</th>
                </tr>
            </thead>
            <tbody>
                <?foreach ($this->mdl_visitors->get(array('select'=>'COUNT(*) AS ref_count, referrer', 'group_by'=>'referrer','where'=>"FROM_UNIXTIME(date, '%m-%d-%Y') = '" . $this->uri_assoc['date'] . "' AND referrer <> ''", 'order_by'=>'ref_count DESC')) as $visitor) {?>
                <tr>
                    <td><?=$visitor->ref_count;?></td>
                    <td><input type="text" value="<?=$visitor->referrer;?>" size="70"></td>
                </tr>
                <?}?>
            </tbody>
        </table>
        <!-- Tables 1 -->
        <br />

        <div style="text-align: center;"><?=$this->mdl_visitors->page_links;?></div>

        <br />
    </div>


</div>
<!-- Content -->

<?$this->load->view('admin/footer');?>